﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml.Serialization;
using DevWeb.Biztalk.DeploymentSettings.Data.CodeFirst;


namespace DevWeb.Biztalk.DeploymentSettings.DeploymentService.Contracts.Model
{
   
    public class ExportModel
    {
        public ExportModel()
        {
            
        }
        public ExportModel(IntegrationVersion integrationVersion)
        {
            Name = integrationVersion.IntegrationName;
            IntegrationDescription = integrationVersion.Integration.Description;
            ProductUpgradeCode = integrationVersion.ProductUpgradeCode;
            ProductId = integrationVersion.ProductId;
            CreateDateTime = DateTime.Now;
            Version = integrationVersion.Version;
            Description = integrationVersion.Description;
            ExportParameters = new List<ExportParameter>();

            foreach (var integrationVersionParameter in integrationVersion.IntegrationVersionParameters)
            {
                var parameter = new ExportParameter(integrationVersionParameter);
                ExportParameters.Add(parameter);
            }

        }
        public string Name
        {
            get;
            set;
        }

        public string IntegrationDescription
        {
            get;
            set;
        }

        public System.Guid ProductUpgradeCode
        {
            get;
            set;
        }

        public System.DateTime CreateDateTime
        {
            get;
            set;
        }


        public  System.Guid ProductId
        {
            get;
            set;
        }

        public  string Version
        {
            get;
            set;
        }

        public  string Description
        {
            get;
            set;
        }


        public List<ExportParameter> ExportParameters { get; set; }
    }
}